ShadowDrawable
This class is a thin wrapper around the library's core draw functionalities, allowing its shadows to be drawn manually without having to use the core module directly.
All ShadowDrawable instances created with an ownerView should call dispose. This is technically not necessary for the @RequiresApi(29) ones, but it is still safe to call dispose on those instances. Use after disposal is not an automatic Exception, but it is not advised, and there is no guaranteed behavior.
The user is responsible for invalidating the current draw whenever a property's value is changed. Failure to do so can result in a few different possible defects, depending on the specific setup, including misaligned clip regions, stale draws, etc.
This drawable's bounds do not affect the shadow's size, shape, or position. Those are initialized from the properties of the Outline set with setOutline, and are able to be modified afterward with the relevant functions and properties; e.g, setPosition, translationX, scaleY, etc.
The color compat functionality is exposed here through the colorCompat property, which is set to black by default, disabling the compat tinting. Setting any non-black color enables color compat, and the ambientColor and spotColor values are then ignored.
The color compat functionality requires a View object. Instances created with the @RequiresApi(29) constructor simply ignore colorCompat.
The Drawable class's required setColorFilter override is a no-op.
When using color compat, the shadows are clipped to the drawable's bounds. Also, due to differences in the native framework, all shadows on API levels 24..28 are clipped to the drawable's bounds.
Inheritors
Constructors
The base constructor for all API levels requires an ownerView in order to be able to hook into the hardware-accelerated draw routine.
At API level 29, an owner View is not required, but color compat is unavailable for these instances.